home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_054 / hanoi / poster < prev   
Text File  |  1992-05-06  |  2KB  |  50 lines

  1. Article 2264 of comp.sys.amiga:
  2. Path: mcdsun!noao!hao!hplabs!decwrl!labrea!navajo!ali
  3. From: ali@navajo.STANFORD.EDU (Ali Ozer)
  4. Newsgroups: comp.sys.amiga
  5. Subject: Towers of Hanoi
  6. Message-ID: <1400@navajo.STANFORD.EDU>
  7. Date: 21 Feb 87 03:50:00 GMT
  8. Reply-To: ali@navajo.ARPA (Ali Ozer)
  9. Distribution: world
  10. Organization: Stanford University
  11. Lines: 481
  12.  
  13. ----->8 cut cut --------
  14.  
  15. Here's a fun little program. It solves the towers of hanoi in a workbench
  16. window of its own... It occupies little space, and is meant to be run
  17. with a low priority (by default, -20). I was inspired by a similar program
  18. I saw running on a workstation once. (But this is better (of course),
  19. because it has color and runs on our favorite micro.) 
  20.  
  21. The program will go on solving the puzzle forever, unless stopped by clicking
  22. on the (invisible) close gadget. The window also provides sizing and depth
  23. gadgets, all also invisible. You can vary the parameters like speed at which
  24. the disks are moved, the number of disks (1..25), colors, etc... From CLI,
  25. you can specify these parameters as command line arguments (type "hanoi ?"
  26. to see what is expected). From the Workbench, the program opens a little
  27. window and asks you for the values... 
  28.  
  29. Using the default values (5 disks, moving pretty slowly, and no text),
  30. and a stack size of 2000, I was able to get 22 hanoi's running (with 512k
  31. memory). Try it if you've got nothing better to do --- it's real fun!
  32. The overall speed at which the puzzle is solved doesn't change, really.
  33. (But, let me warn you, starting up 22 hanois will take some time... By the
  34. last few Intuition is really having a fun time drawing and redrawing all
  35. of the windows, over and over, every time to activate or reactive or resize
  36. any window...)
  37.  
  38. I compiled hanoi with Manx, using 16 bits (code is about 9.2k). It should
  39. compile under Lattice, but that's what I said about YaBoing, too... (and
  40. it didn't)
  41.  
  42. I'll appreciate any comments or suggestions! (But please don't tell me the
  43. disks look too ugly --- I know they do. Oh well! Not much you can do with
  44. RectFill(), you know.)
  45.  
  46. Ali Ozer, ali@score.stanford.edu OR ali@navajo.stanford.edu
  47.  
  48. ------->8 cut here and compile! you might also want to design an icon -----
  49.  
  50.